using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TMM.Common
{
    public abstract class LocalDataBase
    {

        public abstract T Get<T>(string key);

        public abstract void Set<T>(string key, T value);

        public string GetLastServer()
        {
            return Get<string>("ServerCode");
        }

        public void SetAuthenticationData(AuthenticationData authData)
        {
            Set<AuthenticationData>("nextConnectionData", authData);
        }

        public AuthenticationData GetAuthenticationData()
        {
            return Get<AuthenticationData>("nextConnectionData");
        }

        public void ResetAuthenticationData()
        {
            Set<AuthenticationData>("nextConnectionData", null);
        }

        public void SetLastServerCode(string serverCode)
        {
            Set<string>("serverCode", serverCode);
        }

        public string GetLastServerCode()
        {
            return Get<string>("serverCode");
        }
    }
}